/*
 * p4435.cpp
 *
 *  Created on: 2013-10-25
 *      Author: zy
 */
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;
inline int sqr(int x)
{
	return x * x;
}
int N, D;
bool put[128], vis[128];
int g[128][128], x[128], y[128];
int dist[128], q[129];
void make()
{
	for (int i = 0; i < N; i++)
		for (int j = 0; j < N; j++)
			g[i][j] = ceil(sqrt(sqr(x[i] - x[j]) + sqr(y[i] - y[j])));
}
bool ok()
{
	int l, r;
	memset(vis, 0, sizeof(vis));
	for (int i = 0; i < N; i++)
		if (!put[i])
			dist[i] = 0x3f3f3f3f;
		else
			dist[i] = 0;
	l = 0;
	r = 1;
	vis[0] = true;
	q[1] = 0;
	while (l < r)
	{
		l++;
		int u = q[l];
		for (int i = 0; i < N; i++)
			if (!vis[i] && g[u][i] <= D)
			{
				dist[i] = min(dist[i], g[u][i]);
				if (put[i])
				{
					vis[i] = true;
					q[++r] = i;
				}
			}
	}
	for (int i = 0; i < N; i++)
		if (put[i] && !vis[i])
			return false;
		else if (!put[i] && dist[i] * 2 > D)
			return false;
	return true;
}
void work()
{
	for (int i = 0; i < N; i++)
		put[i] = true;
	if (!ok())
	{
		puts("-1");
		return;
	}
	for (int i = N - 1; i >= 1; i--)
	{
		put[i] = false;
		if (ok())
			continue;
		else
			put[i] = true;
	}
	int i = N - 1;
	while (!put[i])
		i--;
	for (; i >= 0; i--)
		if (put[i])
			putchar('1');
		else
			putchar('0');
	putchar('\n');
}
int main()
{
	while (scanf("%d%d", &N, &D) != EOF)
	{
		for (int i = 0; i < N; i++)
			scanf("%d%d", &x[i], &y[i]);
		make();
		work();
	}
	return 0;
}
